package com.lqs.blog.utils;

import com.lqs.blog.pojo.SysUser;

public class UserThreadLocal {
    //私有 不允许被外部创建对象
    private UserThreadLocal() {
    }

    //    线程变量隔离
    private static final ThreadLocal<SysUser> LOCAL = new ThreadLocal<>();

    public static void set(SysUser sysUser) {
        LOCAL.set(sysUser);
    }

    public static SysUser get() {
        return LOCAL.get();
    }

    public static void remove() {
        LOCAL.remove();
    }
}
